import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-default/index.css'
import './assets/styles/main.css'
import VueRouter from 'vue-router'


import Sms from './components/wechat/Sms.vue'
import DiyMenu from './components/wechat/DiyMenu.vue'
import AutoPlay from './components/wechat/AutoPlay.vue'
import Wechat from './components/wechat/Wechat.vue'
import Login from './components/Login.vue'
import Application from './components/Application.vue'
import ApplicationIndex from './components/application/ApplicationIndex.vue'
import PublicSport from './components/application/publicsport/PublicSport.vue'
import Vote from './components/application/vote/Vote.vue'
import VoteIndex from './components/application/vote/Index.vue'
import VoteCheck from './components/application/vote/Check.vue'
import VoteRecord from './components/application/vote/Record.vue'
import VoteAdd from './components/application/vote/Add.vue'
import Register from './components/Register.vue'
import App from './App.vue'


Vue.use(ElementUI)
Vue.use(VueRouter)

const router = new VueRouter({
    routes: [
        { path: '/Wechat', component: Wechat,
            children:[
                {
                    path:'sms',
                    component:Sms
                },
                {
                    path:'autoplay',
                    component:AutoPlay
                },
                {
                    path:'diymenu',
                    component:DiyMenu
                }
            ]
        },
        {
            path:'/login',component:Login
        },
        {
            path:'/register',component:Register
        },
        {
            path:'/application',component:Application,
            children:[
                {
                    path:'index',
                    component:ApplicationIndex
                },
                {
                    path:'publicsport',
                    component:PublicSport
                },
                {
                    path:'vote',
                    component:Vote,
                    children:[
                        {
                            path:'index',
                            component:VoteIndex
                        },
                        {
                            path:'check',
                            component:VoteCheck
                        },
                        {
                            path:'record',
                            component:VoteRecord
                        },
                        {
                            path:'add',
                            component:VoteAdd
                        }
                    ]
                }
            ]
        }
    ]
})


new Vue({
  el: '#app',
  render: h => h(App),
    router
})
